package org.example.day20240830正则;

import java.util.Scanner;

public class Main {
    public static void setAge(int age) {
        if(age > 150){
            AgeInvalidException ageInvalidException
                    = new AgeInvalidException("invalid age " + age);
            try {
                throw ageInvalidException;
            } catch (AgeInvalidException e) {
                throw new RuntimeException(e);
            }
        }

    }
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while (true){
            String msg = scanner.nextLine();
            setAge(230);
        }

//        FileWriter fileWriter = new FileWriter("ddd.txt");
    }
}
